package mrh.niubi.librarysystem.service.impl;

import mrh.niubi.librarysystem.mapper.BorrowerMapper;
import mrh.niubi.librarysystem.pojo.Borrower;
import mrh.niubi.librarysystem.service.BorrowerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BorrowerServiceImpl implements BorrowerService {


    @Resource
    private BorrowerMapper borrowerMapper;
    @Override
    public List<Borrower> selectBorrowersByQueryinf(String queryinf) {
        return borrowerMapper.selectBorrowersByQueryinf(queryinf);
    }

    @Override
    public int delBorrowerByUsername(String username) {
        return borrowerMapper.deleteById(username);
    }

    @Override
    public int addBorrowers(Borrower borrower) {
        return borrowerMapper.insert(borrower);
    }

    @Override
    public int editBorrowers(Borrower borrower) {
        return borrowerMapper.updateById(borrower);
    }
}
